<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    .fu
    {
      background-color: #ffff00;
      width: 500px;
      /*防止 父属性失去高*/
      overflow: hidden;
    }
    .fu>div
    {
      width: 100px;
      height: 100px;
      border : 5px solid #000;

    }
    /*夹一快了*/
    .z1 {background-color: #f00;float: left}
    .z2{background-color: #0f0;float: left}
    .z3{background-color: #00f;float: left}
  </style>
</head>
<body>
<div class="fu">
  <div class="z1"></div>
  <div class="z2"></div>
  <div class="z3"></div>
</div>
</body>
</html>